<template>
  <div class="container_detail word-edit">
    <div class="header">
      <p>门店管理>{{type?'查看品牌总账号':'查看门店'}}</p>
      <el-button class="link" type="primary">
        <router-link :to="{path:type?'brandStoreList':'storeList',query: { pageIndex: currentPage }}" style="color: #fff;">返回</router-link>
      </el-button>
    </div>
    <div class="main">
      <el-form :model="user" :rules="rules" ref="user" label-width="120px" class="">
        <div class="list">
          <div class="title">{{type?'查看品牌总账号':'查看门店'}}</div>
          <el-form-item v-if="!type" prop="storeName">
            <div class="item">
              <div class="item-key">门店名:</div>
              <div class="item-value">
                {{user.storeName}}
              </div>
            </div>
          </el-form-item>
          <el-form-item prop="brandId">
            <div class="item">
              <div class="item-key">所属品牌:</div>
              <div class="item-value">
                {{user.esBrandDTO.brandName}}
              </div>
            </div>
          </el-form-item>
          <el-form-item prop="userName">
            <div class="item">
              <div class="item-key">门店账号:</div>
              <div class="item-value">
               {{user.userName}}
              </div>
            </div>
          </el-form-item>
        </div>
      </el-form>
    </div>
  </div>
</template>

<script>
let CONSTANT = require("../../constant/constant.js");
let common = require("../../common.js");

export default {
  data() {
    return {
      id: "",
      info: "",
      // 返回 导航页码
      currentPage: 1,
      user: {
        "brandId": "",
        "brandName": "",
        "id": "",
        "psw": "",
        "psw2": "",
        "storeName": "",
        "userName": ""
     },
     type:''
    };
  },
  mounted() {
    this.id = this.$router.currentRoute.query.id;
    this.type = this.$router.currentRoute.query.type;
    this.currentPage = this.$router.currentRoute.query.pageIndex
      ? this.$router.currentRoute.query.pageIndex
      : 1;
    this.getDetail();
  },
  methods: {
     getDetail() {
      let url = CONSTANT.URL.LIST.findEsStoreById;
      let data = { id: this.id }
      common.requestAjax(url, JSON.stringify(data), null, res => {
        this.user = res.data.bussData;
      });
    }
  }
};
</script>
<style lang="scss">
.word-edit {
  .el-form-item {
    margin: 0px;
    
  }

  .item-value {
    .el-input {
      width: 50%;
    }
    .el-select {
      width: 50%;
      .el-input {
        width: 100%;
      }
    }
  }
  .el-form-item__content {
    margin: 0px !important;
  }
}
</style>

